import { Asset, Node, SpriteAtlas } from "cc";
import { ViewBase } from "./ViewBase";


export enum ViewLayer {
    SCENE,
    MENU,
    FULL,
    TIPS,
    TOP,

    COUNT,
}

export enum ViewId {
    NONE,
    DEMO_FIRST_MULTI,
    DEMO_FIRST_1,
    DEMO_FIRST_2,
    DEMO_FIRST_3,

    DEMO_SECOND_MULTI,
    DEMO_SECOND_1,
    DEMO_SECOND_2,

    DEMO_THIRD_MULTI,
    DEMO_THIRD_1,
    DEMO_THIRD_2,
    DEMO_THIRD_3,

    DEMO_MAIN,

    COUNT
}

export type TViewConfigResType = { path: string, type: typeof Asset };

// {
//     id: ViewId,
//     name: "",
//     bundleName: "",
//     prefabName: "",
//     layer: ViewLayer,
//     resArr: TViewConfigResType[],
//     viewClazz: new (vCtrl: any, node: Node) => ViewBase & IView,
// }
export type TViewConfig = {
    id: ViewId,
    name: string,
    bundleName: string,
    prefabName: string,
    layer: ViewLayer,
    resArr: TViewConfigResType[],
    viewClazz: new () => ViewBase & IView,
    label: string, //标题文字
    icon: string, //标题icon
}

export interface IViewCtrl {
    node: Node
    view: IView;
    model: any;
    dep: any[];
    config: TViewConfig;
    parseDep(): void;
    create(): Promise<Node>;
    getContent(): Node;
    hide(): void;
    destroy();
    onHideMyRoot(): void;
    
}


export interface IView {
    myViewCtrl: any;
    
}

export interface IViewDataProccesor {
    setData(data: any): void;
}


